import { request } from '@/utils/request'

//分页查找全部数据字典
export const pageDict = function (current, size) {
  return request.get(`/dict/page?current=${current}&size=${size}`)
}

//保存数据字典
export const saveDict = function (entity) {

  return request.post('/dict/info', entity)
}

//分页查找数据字典明细
export const pageDictInfo = function (current, size, dictId) {
  return request.get(`/dict/info/page?current=${current}&size=${size}&dictId=${dictId}`)
}

//更新数据字典明细的默认状态
export const updateDictInfoDefault = function (id, info) {
  return request.put(`/dict/info/default/${id}`)
}

//获得某个数据字典明细
export const getDictInfoById = function (id) {
  return request.get(`/dict/info/${id}`)
}

//上升数据字典明细的排名
export const moveUpDictInfoDefault = function (id) {
  return request.put(`/dict/info/ranking-up/${id}`)
}

//下降数据字典明细的排名
export const moveDownDictInfoDefault = function (id) {
  return request.put(`/dict/info/ranking-down/${id}`)
}

//获得某个数据字典
export const getDictById = function (id) {
  return request.get(`/dict/${id}`)
}

//获得数据字典
export const getDict = function (name) {
  return request.get(`/dict?name=${name}`)
}





